<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .parent {
            display: flex;
            height: 500px;
            width: 400px;
            justify-content: center;
            background-color: blue;
            align-items: center;
        }

        .child {
            height: 200px;
            width: 200px;
            background-color: red;
        }
    </style>
</head>

<body>

    <div class='parent'>
        <div class='child' />
    </div>
</body>

</html>